package com.zjut.an.admin.manager;

import java.util.List;

import javax.annotation.Resource;

import com.zjut.an.admin.dao.AnAdmin;
import com.zjut.an.admin.dao.AnAdminDAO;
import com.zjut.an.util.module.PageModule;


public class AnAdminManager {

	@Resource(name = "AnAdminDAO")
	private AnAdminDAO dao;
	
	public void addData(AnAdmin obj) {	
		dao.save(obj);
	}
	
	public void updateData(AnAdmin obj) {
		dao.update(obj);
	}
	
	public void deleteData(AnAdmin obj) {
		dao.delete(obj);
	}

	public void deleteDatas(List<AnAdmin> objllegeList) {
		for (AnAdmin AnAdmin : objllegeList) {
			dao.delete(AnAdmin);
		}
	}
	
	public PageModule getDataByInstance (int pageNumber,int pageSize, String sort, String order,AnAdmin obj) {
		return dao.findByInstance(pageNumber, pageSize, sort, order, obj);
	}
	
	public List getDatas() {
		return dao.findAll();
	}

	public AnAdmin getData(int objId) {
		return dao.findById(objId);
	}
}
